<?php

class LoginForm extends Block{
	public $templatePath = __DIR__ ;
	public $templateFile = "LoginForm.tpl.std.html";
	public $language = "es_ES";
	public $caption = "Login Form";
	public $description="";
	public $firstname="";
	public $lastname="";
	
	
	
	public function show(){
		
		$this->parseFromFile($this->templatePath."/".$this->templateFile);
		$this->loginUserId->name  = "{$this->oid}[userid]";
		$this->loginPasswd->name   = "{$this->oid}[password]";
		$this->loginUserId->value = isset($_REQUEST[$this->oid]['userid'])?$_REQUEST[$this->oid]['userid']:"";
		$this->loginPasswd->value  = isset($_REQUEST[$this->oid]['password'])?$_REQUEST[$this->oid]['password']:"";
		
		return $this->replace();
	}
	
	public function translate($literal=""){
		
		$literal=trim($literal);
		$dic['es_ES']=array(
			'Password'=>'Contraseña'
			,'Repeat password'=>'Repetir contraseña'
			,'Password and Confirmation'=>'Contraseña y confirmación'
			,'Write your password and Confirmation' => 'Escriba su contraseña y luego vuelva a escribirla para confirmarla.'
			,'Good Password' => 'Buena!'
		);
		$dic['en_US']=array();
		
		if(isset($this->language)){
			if(isset($dic[$this->language][$literal])){
				return $dic[$this->language][$literal];
			}
		}
		return $literal;
	}
}

?>